const router = require ("koa-router")();
const MembersModel = require("../../models/Members");
router.post("/api/delete",async ctx=>{
// 查询数据库
    var {id} = ctx.request.body;
    try {
        await MembersModel.deleteOne({
            _id: id
        })
        ctx.body = {
            code: 200,
            msg: "删除成功"
        }
    } catch (err) {
        console.log("err")
        ctx.body = {
            code:400,
            msg:"请求的参数错误",
            request:"POST /api/delete"
        }
    }
})
module.exports = router;